<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>评测平台首页</title>
    <!--&lt;!&ndash;<meta name="viewport" content="width=device-width,initial-scale=1">&ndash;&gt;-->
    <meta name="viewport" content="width=320,maximum-scale=1.3,user-scalable=no">
    <!--js文件-->
    <script src="./js/jquery.min.js"></script>
    <script src="./js/bootstrap.min.js"></script>
    <!--样式文件-->
    <link rel="stylesheet" href="./css/bootstrap.min.css">
    <link rel="stylesheet" href="css/pingce.css">
</head>
<body>
<!--页面头部开始-->
<div id="heads">
    <!-- 轮播图 -->
    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
            <ol class="carousel-indicators">
                    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
            </ol>
            <div class="carousel-inner" role="listbox">
              <div class="item active">
                <img src="images/banner_01.png" alt="校园资讯">
                <div class="carousel-caption">
                    校园资讯
                </div>
              </div>
              <div class="item">
                <img src="images/banner_02.png" alt="校园通知">
                <div class="carousel-caption">
                        校园通知
                </div>
              </div>
              <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                  </a>
                  <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                  </a>

    </div>
</div>
<!--页面头部结束-->
<!-- 九宫格区域开始 -->
  <!-- 日常生活记录区 -->
<div class="contain clearfix">
   <div class="contain-main clearfix">
       <div class="col-xs-4">
            <div class="list walks">
                    <a href="/walkStep.html"><img src="images/walks.jpg" alt="行走记录">
                     <span> 行走记录</span>  </a> 
            </div> 
       </div> 
       <div class="col-xs-4">
            <div class="list  sports">
                    <a href="sports.html"><img src="images/sports.jpg" alt="健身记录">
                     <span>健身</span>  </a> 
            </div> 
        </div>   
       <div class="col-xs-4">
            <div class="list drinks">
                    <a href="drinks.html"><img src="images/drinks.jpg" alt="健身记录">
                     <span>饮料</span>  </a> 
            </div> 
        </div>
        <div class="col-xs-4 ">
                <div class="list GPS">
                        <a href="gomap"><img src="images/gps_05.png" alt="GPS">
                            <span>GPS</span>
                        </a> 
                 </div>
        </div>
        <div class="col-xs-4 ">
                <div class="list sleep">
                        <a href="javascript:void(0)"><img src="images/sleep.png" alt="GPS">
                            <span>睡眠</span><span class="nows">正在开发</span>
                        </a> 
                 </div>
        </div>
        <div class="col-xs-4 ">
                <div class="list music">
                        <a href="javascript:void(0)"><img src="images/music_06.png" alt="GPS">
                            <span>音乐</span><span class="nows">正在开发</span>
                        </a> 
                 </div>
        </div>
   </div>
</div>
<div class="contain clearfix notices">
        <div class="contain-main clearfix">
             <div class="col-xs-4 ">
                     <div class="list GPS">
                             <a href="/send.html"><img src="images/sao.png" alt="扫描">
                                 <span>扫描签到</span>
                             </a> 
                      </div>
             </div>
             <div class="col-xs-4 ">
                     <div class="list drinks">
                             <a href="/user/notifylist?msg_type=1"><img src="images/notice.png" alt="通知">
                                 <span>通知</span>
                             </a> 
                      </div>
             </div>
            
        </div>
     </div>
  <!-- 游戏区域 -->
<div class="contain clearfix games">
   <div class="contain-main clearfix">
       <div class="col-xs-4 ">
            <div class="list pubgs" onclick="pubgs()">
            <img src="images/pubgs.jpg" alt="绝地求生记录">
             <span>绝地求生</span>
            </div> 
       </div>
        <div class="col-xs-4 ">
                    <div class="list lols">
                            <a href="test.html"><img src="images/lols.jpg" alt="LOL记录">
                            <span> 英雄联盟</span>  
                            </a> 
                    </div>
        </div>
   </div>
</div>
<!-- 九宫格区区域结束 -->
<!-- 模态弹出框 -->
<div class="modal  bs-example-modal-sm" id="waring_2">
        <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                    <a class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></a>
                    <h4 class="modal-title" id="myModalLabel">提示消息</h4>
            </div>
            <div class="modal-body" >
                请稍等...
            </div>
        </div>
        </div>
</div>
<script>
// 轮播图时间控制
$('.carousel').carousel({interval: 5000})
//显示下一条信息
function showdesc(a){
    var pare = a.parentNode;
    var p = pare.parentNode;
    var q = p.children[0].children[1];
    var cate_id = q.value;
    var t1 = pare.firstElementChild;
    var t2 = pare.lastElementChild;
    t1.innerText="下一条";
    $.ajax({
        type:"get",
        url:"/admin/catedes?cate_id="+cate_id,
        dataType:"json",
        success:function(data){
            t2.innerText=data;
        }
    });
}
// 封装提示函数
function modals(warings){
    $(".modal-body").text(warings);
    $(".modal .close").click(function(){ $(".modal").hide();$(".modal-body").text("请稍等...")})
    setTimeout(function(){ $(".modal").hide();$(".modal-body").text("请稍等...")},2000)
}
// 判断用户是否绑定
function pubgs(){
    $.ajax({
       url:"/user/getpubgdata",
       type:"get",
       dataType:"json",
       success:function(results){
            console.log(results)
            if (results.code == 200) {
                      window.location.href="/pubg-rader.html"  
				} else if(results.code == 400){
                    $(".modal").show();
                    modals("还未绑定游戏角色名，请绑定！") 
                    setTimeout(function(){ window.location.href="/pubg_bind.html"},2000)
         }
       }
    })
}
//提交表单
function sub(a){
    //var d = a.parentNode.parentNode.parentNode.parentNode.parentNode;
    //d.submit();

//    var cate_id = $("#cate_id").val();
//    var cate = $("#cate").val();
//    var spec = $("#spec").val();
    var cate_id = $("#cate_id").val();
    var cate = $("#cate option:selected").val();
    var spec = $("#spec option:selected").val();

   $.ajax({
       url:"/user/submitdata?cate_id="+cate_id+"&cate="+cate+"&spec="+spec,
       type:"get",
       dataType:"json",
       success:function(data){
            //隐藏弹出框
            $(".modal").hide();
            $("body").removeClass('modal-open')
            $(".modal-backdrop").remove();
       }
   })
    
}
</script>
</body>
</html>